<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<title>鸡蛋白游戏二</title>
<link rel="stylesheet" href="../public/glair_game2.css" />
<script type="text/javascript" src="../../js/jquery.js"></script>
</head>
<body>
<div id="game">
  <div class="line">
    <span></span>
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>
<script type="text/javascript">
  var random = parseInt(Math.random()*(0-4)+4);
  var window_height = $(this).height(); //获取屏幕高度
  var span_height = window_height/3; //获取每个span块的高度
  var pro = $("#game .line").find("span").length; //获取一行span的个数
  var line = $("#game").find(".line").length;
  $("#game .line").find("span").eq(random).addClass("black");
  $("#game .line span").css("height",span_height);
  if(line < 4){
    $('#game').append($("#game").eq(0).html()); 
  }









  $(function(){
    auto2();
  });
  
  /*字体大小自适应rem单位*/
  function auto2(){
    var width = $('body').width();
    var font_size = 22*(width/320);
    var font_size2 = (width/320)*625+'%';
    $('body').css('font-size',font_size);
    $('html').css('font-size',font_size2);
  }

  /*浏览器横屏坚屏改变时也运行函数*/
  window.onorientationchange = function() {
    auto2();
  };

  /* 浏览器窗口发生改变也运行函数*/
  window.onresize=function(){
    auto2();
  };
</script>
</body>
</html>